import { createVNode, render } from 'vue'
import ContextMenu from './ContextMenu.vue'
import { MenuOptionInterface } from './ContextMenu.dto'

const div = document.createElement('div')
export function openMenu(left: number, top: number, menuOptions: Array<MenuOptionInterface>) {
  const instance = createVNode(ContextMenu, {
    left,
    top,
    show: true,
    menuOptions
  })
  document.body.append(div)

  render(instance, div)
}
